/**
 * 
 */
package com.xb.cloud.product.merchant.service.impl;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.xb.cloud.common.JsonUtils;
import com.xb.cloud.product.merchant.inner.service.ProductSkuExtDescInnerService;
import com.xb.cloud.product.merchant.service.client.ProductSkuExtDescService;
import com.xb.cloud.product.merchant.service.client.bo.EndMerchantUserBo;
import com.xb.cloud.product.service.business.model.ProductSkuExtDescription;
import com.xb.cloud.service.client.ServiceReturnCodes;
import com.xb.cloud.service.client.ServiceReturnInfo;
import com.xb.cloud.service.client.ServiceReturnUtils;

/**
 * 富文本服务类.
 * 
 * @author kexue
 *
 */
@Service
public class ProductSkuExtDescServiceImpl extends AbstractService implements ProductSkuExtDescService {

	private static final Logger LOGGER = LoggerFactory.getLogger(ProductSkuExtDescServiceImpl.class);

	@Resource
	private ProductSkuExtDescInnerService productSkuExtDescInnerService;

	/**
	 * 保存sku的文本描述内容
	 */
	@Override
	public ServiceReturnInfo createSkuExtDesc(String detailContent, Long productSkuId,
			EndMerchantUserBo endMerchantUserBo) {
		
		Long id = productSkuExtDescInnerService.createSkuExtDesc(detailContent, productSkuId, endMerchantUserBo);
		if (id <= 0) {
			LOGGER.error("插入sku 描述失败");
			return ServiceReturnUtils.error(ServiceReturnCodes.SYSTEM_EXCEPTION);
		}
		return ServiceReturnUtils.success(id);
	}

}
